package com.hrt.bean;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 礼品详细信息表（规格）
 */
@Entity
@Table(name = "gift_detail")
public class GiftDetail implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 详细ID
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "DEID", length = 500)
	private Long id;
	/**
	 * 礼品id
	 */
	@Column(name = "GI_ID", insertable=false,updatable=false)
	private Long giftId;
	/**
	 * 礼品编号
	 */
	@Column(name = "GI_CODE", length = 500)
	private String giftCode;
	
	
	/**
	 * 规格编号
	 * */
	@Column(name = "GD_CODE",length = 500)
	private String gdCode;
	
	/**
	 * 规格名称
	 * */
	@Column(name = "GD_NAME", length = 500)
	private String gdName;
	
	/**
	 * 礼品名称
	 */
	@Column(name = "GI_NAME", length = 500)
	private String giftName;
	
	/**
	 *  大字段；颜色
	 *//*
	@Lob
    @Column(name = "GI_COLOR", columnDefinition = "BLOB")
	private byte[] color;
	
	@Transient
	private String color_str;*/
	@Column(name = "GI_COLOR", length = 500)
	private String color;
	 
	/**
	 * 成本价
	 */
	@Column(name = "ENTER", length = 500)
	private Double enterPrice = 0d;
	
	/**
	 * 零售价格
	 */
	@Column(name = "SALE_PRICE", length = 500)
	private Double salePrice = 0d;
	
	/** 
	 * 折扣价
	 */
	@Column(name = "DISCOUNT", length = 500)
	private Double discount;
	
	/**
	 * 团购价
	 */
	@Column(name = "GROUPS", length = 500)
	private Double groupPrice = 0d;
	
	/**
	 * 包邮价
	 */
	@Column(name = "MAIL_PRICE", length = 500)
	private Double mailPrice = 0d;
	
	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	/**
	 * 库存量
	 */
	@Column(name = "TOTALS", length = 500)
	private Long totals = 0l;
	
	
	/**
	 * 是否团购
	 */
	@Column(name = "ISGROUP", length = 500)
	private Integer isGroup = 0;
	
	/**
	 * 是否使用套餐 0不使用 1使用
	 */
	@Column(name = "ISPACKAGE", length = 500)
	private Integer isPackage = 0;
	
	/**
	 * 是否促销 0不进行促销 1促销
	 */
	@Column(name = "ISPROMOTE", length = 500)
	private Integer isPromote = 0;
	
	/**
	 * 是否包邮
	 */
	@Column(name = "ISMAIL", length = 500)
	private Integer isMail = 0;
	
	/**
	 * 产品主图片
	 */
	@Column(name = "PIC", length = 500)
	private String pic;
	
	/**
	 * 上下架状态 0 下架 1上架
	 */
	@Column(name = "ISPUSH", length = 500)
	private Integer ispush = 0;
	
	/**
	 * 产品录入人ID,关联后台用户表主键
	 */
	@Column(name = "CREATOR", length = 500)
	private Long creator;
	
	/**
	 * 录入人名称
	 */
	@Column(name = "CREATOR_NAME", length = 500)
	private String creatorName;
	
	/**
	 * 创建时间, 默认系统当前时间
	 */
	@Column(name = "CREATE_TIME", length = 500)
	private Timestamp createTime;
	
	/**
	 * 修改人,第一次插入数据时，修改人与创建人一致
	 */
	@Column(name = "EDITOR", length = 500)
	private String editorName;
	
	/**
	 * 产品修改人ID,关联后台用户表主键
	 */
	@Column(name = "EDITOR_ID", length = 500)
	private Long editorId;
	
	/**
	 * 最后修改时间,录入数据时，录入时间和最后修改时间一致
	 */
	@Column(name = "EDIT_TIME", length = 500)
	private Timestamp editTime;
	
	/**
	 * 删除标记 0未删除 1已删除
	 */
	@Column(name = "ISDELETE", length = 500)
	private Integer isdelete = 0;
	

	/**
	 * 高度
	 */
	@Column(name = "HEIGHT", length = 500)
	   private Double height;
	   /**
	    * 宽度
	    */
	@Column(name = "WEIDTH", length = 500)
	   private Double width;
	  /**
	   * 长度
	   */
	@Column(name = "LONGINESS", length = 500)
	   private Double longiness;
	
	/**
	 * 规格数量
	 */
	@Column(name = "DETAI_NUM", length = 500)
	private Long detailNum;

	/**
	 * 礼品基本信息
	 */
	@ManyToOne(cascade = {CascadeType.REFRESH,CascadeType.MERGE},optional = false)
	@JoinColumn(name = "GI_ID")
	private GiftInfor giftInfor;
	
	/**订单详情的id*/
	@Transient
	private Long orderDetailId;

	/**
	 * 构造函数
	 */
	public GiftDetail() {
	}

	/**
	 * get/set方法
	 * 
	 */

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}

	
	public String getGiftCode() {
		return giftCode;
	}
	public void setGiftCode(String giftCode) {
		this.giftCode = giftCode;
	}



	public String getGiftName() {
		return giftName;
	}
	public void setGiftName(String giftName) {
		this.giftName = giftName;
	}
	
	

	public Double getEnterPrice() {
		return enterPrice;
	}
	public void setEnterPrice(Double enterPrice) {
		this.enterPrice = enterPrice;
	}
	

	public Long getGiftId() {
		return giftId;
	}

	public void setGiftId(Long giftId) {
		this.giftId = giftId;
	}

	public Double getSalePrice() {
		return salePrice;
	}
	public void setSalePrice(Double salePrice) {
		this.salePrice = salePrice;
	}


	public Double getDiscount() {
		return discount;
	}
	public void setDiscount(Double discount) {
		this.discount = discount;
	}


	public Double getGroupPrice() {
		return groupPrice;
	}
	public void setGroupPrice(Double groupPrice) {
		this.groupPrice = groupPrice;
	}


	public Double getMailPrice() {
		return mailPrice;
	}
	public void setMailPrice(Double mailPrice) {
		this.mailPrice = mailPrice;
	}


	public Long getTotals() {
		return totals;
	}
	public void setTotals(Long totals) {
		this.totals = totals;
	}


	public Integer getIsGroup() {
		return isGroup;
	}
	public void setIsGroup(Integer isGroup) {
		this.isGroup = isGroup;
	}


	public Integer getIsPackage() {
		return isPackage;
	}
	public void setIsPackage(Integer isPackage) {
		this.isPackage = isPackage;
	}


	public Integer getIsPromote() {
		return isPromote;
	}
	public void setIsPromote(Integer isPromote) {
		this.isPromote = isPromote;
	}


	public Integer getIsMail() {
		return isMail;
	}
	public void setIsMail(Integer isMail) {
		this.isMail = isMail;
	}


	public String getPic() {
		return pic;
	}
	public void setPic(String pic) {
		this.pic = pic;
	}


	public Integer getIspush() {
		return ispush;
	}
	public void setIspush(Integer ispush) {
		this.ispush = ispush;
	}


	public Long getCreator() {
		return creator;
	}
	public void setCreator(Long creator) {
		this.creator = creator;
	}


	public String getCreatorName() {
		return creatorName;
	}
	public void setCreatorName(String creatorName) {
		this.creatorName = creatorName;
	}


	public Timestamp getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}


	public String getEditorName() {
		return editorName;
	}
	public void setEditorName(String editorName) {
		this.editorName = editorName;
	}


	public Long getEditorId() {
		return editorId;
	}
	public void setEditorId(Long editorId) {
		this.editorId = editorId;
	}


	public Timestamp getEditTime() {
		return editTime;
	}
	public void setEditTime(Timestamp editTime) {
		this.editTime = editTime;
	}


	public Integer getIsdelete() {
		return isdelete;
	}
	public void setIsdelete(Integer isdelete) {
		this.isdelete = isdelete;
	}


	public Double getHeight() {
		return height;
	}
	public void setHeight(Double height) {
		this.height = height;
	}


	public Double getWidth() {
		return width;
	}
	public void setWidth(Double width) {
		this.width = width;
	}


	public Double getLonginess() {
		return longiness;
	}
	public void setLonginess(Double longiness) {
		this.longiness = longiness;
	}


	public GiftInfor getGiftInfor() {
		return giftInfor;
	}
	public void setGiftInfor(GiftInfor giftInfor) {
		this.giftInfor = giftInfor;
	}

	public String getGdCode() {
		return gdCode;
	}

	public void setGdCode(String gdCode) {
		this.gdCode = gdCode;
	}

	public String getGdName() {
		return gdName;
	}

	public void setGdName(String gdName) {
		this.gdName = gdName;
	}

	public Long getDetailNum() {
		return detailNum;
	}

	public void setDetailNum(Long detailNum) {
		this.detailNum = detailNum;
	}

	public Long getOrderDetailId() {
		return orderDetailId;
	}

	public void setOrderDetailId(Long orderDetailId) {
		this.orderDetailId = orderDetailId;
	}

}
